<?php
/*
Bitsand - a web-based booking system for LRP events
Copyright (C) 2006 - 2009 The Bitsand Project (http://bitsand.googlecode.com/)

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

include ('../inc/inc_head_db.php');
include ('../inc/inc_admin.php');
include ('../inc/inc_head_html.php');

//Get list of players & car registration numbers
$db_prefix  = DB_PREFIX;
$sql = "SELECT plFirstName, " .
	"plSurname, " .
	"plCarRegistration, " .
	"bkDatePaymentConfirmed " .
	"FROM {$db_prefix}players, {$db_prefix}bookings " .
	"WHERE plPlayerID = bkPlayerID AND bkDatePaymentConfirmed <> '0000-00-00' AND bkDatePaymentConfirmed <> '' " .
	"ORDER BY plSurname";
$result = ba_db_query ($link, $sql);
?>

<span class = "noprint"><i>Note that this page is designed to be printed. It will look different when printed. Use Print Preview to see the difference.</i></span>

<p>
<?php echo DISCLAIMER_TEXT?>
</p>
<table width = "100%">
<thead>
<tr><th width = '10%'>Name</th><th width = '10%'>Car Reg</th><th>Signature</th></tr>
</thead>

<tbody>
<?php
$iRowCount = 0;
while ($row = ba_db_fetch_assoc ($result)) {
	echo "<tr><td width = '10%'>" . $row ['plFirstName'] . " " . $row ['plSurname'] . "</td>";
	echo "<td width = '10%'>" . $row ['plCarRegistration'] . "</td><td>&nbsp</td></tr>\n";
	if ($iRowCount++ > 12) {
		//Start a new table and force a page break
		echo "</table>\n<p style = 'page-break-before:always'>" . DISCLAIMER_TEXT . "</p>\n<table width = '100%'>\n";
		echo "<thead><tr><th width = '10%'>Name</th><th width = '10%'>Car Reg</th><th>Signature</th></tr></thead>\n";
		$iRowCount = 0;
	}
}
echo "</tbody>\n";
echo "</table>\n";

//Close link to database
ba_db_close ($link);
?>
